/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package util;

import java.util.HashMap;
import java.util.Iterator;
import java.util.LinkedList;
import semantics.Run;
import semantics.RunStep;
import syntax.Transition;

/**
 *
 * @author ennouaary
 */
public class PerfectDiscriminationTree {
    HashMap<Transition, PerfectDiscriminationTree> prefixes;
    Run run;

    public PerfectDiscriminationTree() {
        prefixes = new HashMap<>();
        run = null;
    }
    
    public void addRun(Run run) {
        LinkedList<RunStep> path = run.getPath();
        PerfectDiscriminationTree curNode = this;
        
        Iterator<RunStep> iterRS = path.iterator();
        
        
        for (RunStep curRS : path) {
            if (curNode.prefixes.containsKey(curRS.getTransition())) {
                curNode = curNode.prefixes.get(curRS.getTransition());
            }
            else {
                break;
            }
        }
                
        
    }
}
